<?php
class Admin_Form_Page extends Zend_Form
{

	public function init()
	{
		// Config
		$this->setName('pageform')->setAction('/editpage/process')->setMethod('POST');

		//Validators
		$length_validate = new Zend_Validate_StringLength(6, 50);

		/********************************************************************************
		 NAME
		*********************************************************************************/

		$title = new Zend_Form_Element_Text('title');
		$title->setLabel('Title')
		//->addFilters(array('StringTrim', 'HtmlEntities'))
		->setAttrib('minlength', '6')
		->setAttrib('class', 'field-text large required')
		->setDecorators(array(	'ViewHelper', 'Description', 'Errors',	array(array('data' => 'HtmlTag'), array('tag' => 'span')),
				array('Label', array('tag' => 'span')),
				array(array('row' => 'HtmlTag'), array('tag' => 'p', 'class' => 'clear'))
		))
		->addValidator($length_validate);

	  
		/********************************************************************************
		 DESCRIPTIONS
		*********************************************************************************/

		require_once 'Descriptionform.php';
	  
	  
		/********************************************************************************
		 SEO
		*********************************************************************************/
		
		require_once 'Seoform.php';
		
		$this->addElements(array(
				$title,
				$description_vi,
				$description_en,
				$description_ja,
				$description_zh,
				$description_fr,
				$alias_vi,
				$alias_en,
				$alias_ja,
				$alias_zh,
				$alias_fr,
				$metatag_vi,
				$metatag_en,
				$metatag_ja,
				$metatag_zh,
				$metatag_fr,
				$keyword_vi,
				$keyword_en,
				$keyword_ja,
				$keyword_zh,
				$keyword_fr,
				
		));

		//$this->addDisplayGroup(array($title_vi, $title_en), 'display');

		$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'section')), 'Form'));
		return $this;
	}
}

?>